{extend name="public:default" /}

<!-- 搜索栏 -->
{block name="form"}
{/block}

<!-- 头工具栏 -->
{block name="tableTopBtn"}

    <button class="layui-btn layui-btn-danger layui-btn-sm" lay-event="del"><i class="layui-icon"></i></button>
    <button class="layui-btn layui-btn-primary layui-btn-sm" lay-event="add"><i class="layui-icon"></i></button>
    
{/block}

<!-- 行工具栏 -->
{block name="tableEndBtn"}

    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="edit"><i class="layui-icon"></i></a>
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"><i class="layui-icon"></i></a>

{/block}

<!-- js 执行方法 -->
{block name="script"}
<script>
    var editList = window.location.pathname // 列表链接
    var editAdd = editList + 'Add' // 添加链接
    var editUp = editList + 'Up' // 修改链接
    var editDel = editList + 'Del' // 删除链接

    views.setUrl(editAdd,editDel,editUp).cols({
        url: editList,
        page: false,
        cols: [
            {type: 'checkbox', fixed: 'left'}

            ,{field:'id', title:'ID', align:'center'}
            ,{field:'admin_nav_sort', title:'排序', align:'center'}
            ,{field:'admin_nav_title', title:'导航名称', width:300}
            ,{field:'admin_nav_url', title:'地址', align:'center'}
            ,{field:'admin_nav_but', title:'按钮', align:'center'}
            ,{field:'admin_nav_is_show', title:'是否显示', align:'center', templet:function(d){ return d ? '显示' : '隐藏' ;}}
            ,{field:'admin_nav_times', title:'添加时间', align:'center'}

            ,{fixed: 'right', title:'操作', toolbar: '#test-table-toolbar-barDemo', width:120}
        ]

    }).toolbar(function(obj,data,table){
        // 头工具栏事件

    }).tool(function(obj,table){
        //监听行工具事件
    }).get();


    
</script>
{/block}
  
  